Repository navigation
feat(id-native-shell): Bevy audio renderer for audio/1 surfaces (#12657 step 2b) - #13244
Merged
Merged
Conversation
… step 2b) Two layers mirroring the step-2a scene renderer, all in pkgs/id/crates/id-native-shell: - audio::AudioModel — a Bevy-independent presentation model: a validated AudioSurface becomes a cue schedule (cues sound one at a time in document order, each starting when the previous ends; a repeating cue loops until the view changes and later cues wait indefinitely) plus a fallback tone per cue, stepped deterministically from the cue id over the octave above 220 Hz. cue_phase() is the pure phase function the playback system and the tests share. - audio::AudioRenderPlugin — on each presented-view sequence change, one entity per cue carrying its prescribed CueSchedule; a chained system keeps a Sounding marker on exactly the cues the phase function calls audible at the view's playhead. Non-audio views clear the cue entities and playback state. The plugin owns presentation state only: the crate's Bevy feature set carries no audio output backend, so device playback is a later wiring step over the same entities and schedule. - audio::example_audio — the deterministic example world's audio (the harbor of example_scene: buoy bell, gulls, looping waves). The binary registers AudioRenderPlugin beside SceneRenderPlugin. Shells without the plugin keep the audio text projection through ScreenGrid (parity test included). Verification (laptop, nix develop in pkgs/id): cargo nextest run -p id-native-shell 91 passed / 0 failed (81 baseline + 10 new audio tests: model determinism, back-to-back schedule + open-ended total, tone derivation bounds, phase function incl. repeat looping and cues behind a repeat, from_view gating, entity spawn + schedule fields, first-cue sounding marker, clear on non-audio view, text projection parity); cargo fmt clean; clippy has no findings in the new module (the workspace clippy run still stops earlier on the pre-existing id-store expect() sites tracked by #13207, untouched).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2b of #12657: the Bevy audio renderer in
pkgs/id/crates/id-native-shell, following the two-layer shape step 2a (PR #13214) established for the scene renderer. Step 2c (widget renderer) remains after this, so #12657 stays open.What lands
audio::AudioModel— a Bevy-independent presentation model. A validatedAudioSurfacebecomes a cue schedule: cues sound one at a time in document order, each starting when the previous one ends; a repeating cue loops until the view changes (cues behind it wait indefinitely, and the schedule total is open-ended). Each cue also gets a derived fallback tone — thirteen semitone steps over the octave above 220 Hz, chosen by the cue id's FNV-1a hash — for presenters holding no world asset for the cue.cue_phase()is the pure phase function (Waiting / Sounding / Looping / Finished) the playback system and the tests share.audio::AudioRenderPlugin— on each presented-view sequence change it despawns the old view's cue entities and spawns one entity per cue carrying its prescribedCueSchedule; a chained system keeps aSoundingmarker on exactly the cues the phase function calls audible at the view's playhead. Non-audio views clear the cues and the playback state. Shells without the plugin keep presenting the audio text projection throughScreenGrid(parity test included).audio::example_audio— the deterministic example world's audio: the harbor ofexample_scene(buoy bell, gulls, looping waves).AudioRenderPluginbesideSceneRenderPlugin.Scope boundary, stated plainly: the plugin owns presentation state only. This crate's Bevy feature set carries no audio output backend (
bevy_audiowould pull rodio/cpal and need ALSA wiring in the flake), so device playback is a later wiring step that consumes these same entities and this same schedule. No new Cargo features were added.Verification (laptop route,
nix developinpkgs/id; remote dispatch not used — the fleet-build container cannot runnix develop, the #13159-family gap):cargo nextest run -p id-native-shell: 91 passed / 0 failed — the 81-test baseline plus 10 new audio tests (model determinism, back-to-back schedule + open-ended total, tone derivation bounds, phase function incl. repeat looping and cues behind a repeat,from_viewgating, entity spawn with schedule fields, first-cueSoundingmarker, clear on non-audio view, text-projection parity).cargo fmt --check -p id-native-shell: clean.id-storeexpect()sites tracked by id-store: admission.rs expect() on Mutex locks breaks the clippy gates on main (PR #13156) #13207 — untouched here).{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T12:16:42Z", "session_id": null, "lane": null, "host": "amd", "worktree": "/home/user/wt-lane-sy-12657", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/user/wt-lane-sy-12657", "repo": "developing-today/code", "branch": "lane-sy-12657", "sha": "538f48fe95f4b6e4be26efa4bd6e6b9a3a9105e0" }, "auth_subject": "codex-scheduled-b", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.